package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.entity.SpecGroup;
import com.leyou.item.entity.SpecParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SpecGroupMapper extends BaseMapper<SpecGroup> {

    @Select("select * from tb_spec_group sg, tb_spec_param sp where sg.id = sp.group_id and sg.category_id = #{cid}")
    List<SpecGroup> findGroudsAndParamsByCategoryId(@Param("cid") Long cid);

}
